package com.shallwead.bna.Async;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;

import com.shallwead.bna.object.AdTracker;
import com.shallwead.bna.util.JSON;

public class TrakerAsync extends AsyncTask<Void, String, Boolean> {

	Context mContext;
	String Url;
	AdTracker adTracker;

	public TrakerAsync(Context mContext, String Url, AdTracker adTracker) {
		this.mContext = mContext;
		this.Url = Url;
		this.adTracker = adTracker;
	}

	@Override
	protected Boolean doInBackground(Void... params) {
		return JSON.sendAdTracker(mContext, adTracker);
	}

	@Override
	protected void onPostExecute(Boolean result) {
		super.onPostExecute(result);
		mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Url)));

	}

}
